Repository navigation
fix(dbt-tools): move to dbt-integration 0.3.15 so the dbt adapter starts under Bun - #1368
ralphstodomingo wants to merge 6 commits into
Conversation
…rts under Bun `dbt-tools` resolved `@altimateai/dbt-integration` 0.2.14, which spawns its Python child through `python-bridge`. Under Bun that module fails to load (`bluebird.promisifyAll(child_process)` throws on `ChildProcess.prototype.stdin`), and past that, Bun's IPC to a non-JS child closes after the first message. So the dbt-first path of `sql_execute` never ran; the adapter silently fell back. 0.3.x vendors the bridge and talks newline JSON over a plain fd-3 pipe, with no `python-bridge` or `bluebird` in the tree. - `adapter.ts`: the 0.3.x constructors take `UnitTestParser` and `SemanticModelParser`; the Fusion integration no longer takes the cloud-variant detector (the Cloud integration still does). - `copy-python.ts`: the vendored bridge resolves its script from the bundle's own location at runtime, so the `python-bridge` `__dirname` patch is gone; the build now fails if a build-time path is baked in. `build-adversarial.test.ts` tested only that patch and is removed; `build-integrity.test.ts` and the release smoke check assert the new invariant. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0172qrhMa5TQgETASi5hxMqD
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…published package from elsewhere Restores the checks from the removed patch tests that do not depend on the patch: no build-machine path anywhere in the bundle, altimate_python_packages copied, __require from createRequire, and byte-identical consecutive builds. Adds a runtime check the old suite only approximated: the package laid out as publish.ts ships it, run by Node from another directory, starts the bridge script next to its own bundle. A stand-in python records the spawn, so the test needs neither Python nor dbt. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0172qrhMa5TQgETASi5hxMqD
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0172qrhMa5TQgETASi5hxMqD
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0172qrhMa5TQgETASi5hxMqD
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0172qrhMa5TQgETASi5hxMqD
…y starts the bridge 0.3.15 writes the bridge script to a temporary directory when it runs from a single-file executable, instead of looking for it in `/$bunfs`. The lockfile pins 0.3.15; Bun applies `minimumReleaseAge` only when it resolves a version. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0172qrhMa5TQgETASi5hxMqD
|
@codex review Round on ccc92cc, the whole PR. Please review it against the numbered claims (C1–C4) and residuals (R1–R2) in the description. Report only a concrete trace that violates a numbered claim: a runtime (Bun from source, the compiled binary, or |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Issue for this PR
Closes #1367
Type of change
What does this PR do?
Moves
packages/dbt-toolsfrom@altimateai/dbt-integration0.2.14 to^0.3.15. 0.2.x started its Python child throughpython-bridge, which fails under Bun (bluebird.promisifyAllonchild_processthrowsCannot access invalid private field (evaluating 'this.#stdin')), so the dbt-first path ofsql_executenever ran. 0.3.x vendors the bridge and uses a plain fd-3 pipe;python-bridgeandbluebirdleave the lockfile. From 0.3.15, a bridge running inside a single-file executable writes its script to a temporary directory and removes it on exit, so the compiled binary starts the bridge too.adapter.ts: 0.3.x'sDBTProjectIntegrationAdaptertakes aUnitTestParserand aSemanticModelParser; the Fusion integration no longer takes the cloud-variant detector (the Cloud integration still does).copy-python.ts/release.yml/publish.ts: the vendored bridge findsnode_python_bridge.pyfrom the bundle's own location at runtime (fileURLToPath(import.meta.url)), so thepython-bridge__dirnamepatch is gone. The build and the release smoke check now assert the new resolution instead of the patch.build-adversarial.test.tstested the removed patch. The checks in it that don't depend on the patch move tobuild-integrity.test.ts(no build-machine path in the bundle, Python packages copied,createRequire, byte-identical rebuilds). A new test runs the package aspublish.tslays it out, from another directory, and checks that it starts the bridge script next to its own bundle.Claims
sql_executestarts the dbt adapter and runs the query through dbt, from source and from the compiled binary./$bunfs. No Python process and no temporary bridge directory is left after the call.altimate-dbt, laid out aspublish.tsships it and run by Node from another directory, starts thenode_python_bridge.pynext to its own bundle. The build and the release smoke check fail if a build-time path is baked into the bundle.adapter.tsbuilds the adapter with what 0.3.x's constructors take: both new parsers, and the cloud-variant detector for dbt Cloud only.Residuals
minimumReleaseAge. The lockfile pins it, and Bun applies that window only when it resolves a version, so installs from the lockfile take 0.3.15. The lockfile change for it is that one entry; its dependencies are the same as 0.3.13's.sql_executestill falls back to the configured warehouse without saying why. That's unchanged by this PR.How did you verify your code works?
sql_executecalled through the real tool registry (debug agent build --tool sql_execute, no model turn), against a two-model dbt-core 1.11.7 / DuckDB project with its own venv, queryselect count(*) as n from customer_totals:n = 2via dbtmain(2026-09-29): falls back, "No warehouse configured"n = 2via dbt/tmp/altimate-dbt-integration-<random>/bridge.py. Python processes were sampled every 200 ms; none was left after the call, and neither was the temporary directory.@altimateai/dbt-integration@0.3.15/dist/node_python_bridge.py.altimate-dbtas npm ships it (publish.tslayout, Node 22, run from another directory),execute --query …:[{"n": 2}], as onmain.packages/dbt-tools: typecheck clean, build verified, 88 tests pass. The relocation test fails when a fixed path is baked into the bundle.packages/opencode: typecheck clean.Checklist
Appendix: complexity delta
✅ No touched function changed in complexity (2 touched, 0 new, all under 10). Advisory, not a gate.
🤖 Generated with Claude Code
https://claude.ai/code/session_0172qrhMa5TQgETASi5hxMqD